﻿@{ Layout = null;}
@using MerchantTribeStore
@functions{
    List<string> ListSafeScripts()
    {
        List<string> result = new List<string>();
        
        string keyName = "SafeRegisteredScripts";
        object list = ViewData[keyName];
        if (list == null) 
        {
            list = new List<string>();
        }
        if (list != null)
        {
            List<string> registered = (List<string>)list;
            if (registered != null)
            {
                return registered;
            }
        }                
        return result;
    }
}
@foreach (string s in ListSafeScripts())
{
    string destination = s;
    if (s.ToLowerInvariant().StartsWith("~"))
    {
        destination = Url.Content(s);
    }
    <script src="@Html.Raw(destination)" type="text/javascript"></script>                    
}


